/**
 * 
 */
package com.xpec.c4.game.login.command;

import com.ms.service.module.zone.command.BasicDebugCommand;
import com.xpec.c4.game.utility.GameUtility;
import com.xpec.c4.message.MessageTypes;
import com.xpec.c4.service.group.transportlayer.GroupMessage;
import com.xpec.c4.service.message.MessageAction;

/**
 * 模擬自己登入到指定的 zone
 * 
 * @author TW15010
 */
public class FakeLoginCommand extends BasicDebugCommand {
	@Override
	public String execute() {
		String dstZoneId = getParam(1);
		if (!GameUtility.isHaveString(dstZoneId)) {
			return getDescription();
		}

		GroupMessage msg = new GroupMessage();
		msg.setDestModuleID(dstZoneId);
		msg.setMessageType(MessageTypes.S_ZONE_FAKE_PLAYER_LOGIN);
		msg.setMessageContent(player);
		msg.setSessionID(player.getSessionID());

		MessageAction.sendGroupMessage(msg);

		return "ok";
	}

	@Override
	public String getName() {
		return "fakelogin";
	}

	@Override
	public String getDescription() {
		return getName() + " [dst zone id]";
	}

	@Override
	public String getShortDescription() {
		return "simulate self login to some zone.";
	}
}
